<%-- 
    Document   : LoginPage
    Created on : 25-mar-2011, 2:12:24
    Author     : Alberto
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" class="cufon-active cufon-ready">
    <head>
        <title>UAO</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="style.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="js/cufon-yui.js"></script>
        <script type="text/javascript" src="js/arial.js"></script>
        <script type="text/javascript" src="js/cuf_run.js"></script>
    </head>
    <body>
        <div class="main">
            <div class="header">
                <div class="header_resize">
                    <div class="logo">
                        <h1><a href="#">UAO <span></span></a><small>University Accomodation Office</small></h1>
                    </div>
                    <div class="clr"></div>
                    <div class="menu_nav">
                    </div>
                    <div class="clr"></div>
                </div>
            </div>

        </div>
        <div class="clr"></div>
        <form action="LoginServlet" name="login" onsubmit="return validateForm();">


			Nombre de usuario
            <input type="text" name="un"/><br>

			Contraseña
            <input type="password" name="pw"/>
<input type="button" value="apretar" onclick="valida_formulario('login')">
            <input type="submit" value="submit">

        </form>
        <script language="javascript">
       function validateForm(nom)
        {
            alert("Direccion de correo electrónico no válido");
            txt = document.getElementById(nom).campo_texto.value;
            if(txt==""){
		alert("El campo está vacío");
		return 0;
            }
            document.getElementById(nom).submit();
 /*       var x=document.forms["login"]["un"].value
        var atpos=x.indexOf("@");
        var dotpos=x.lastIndexOf(".");
        if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
          {
          alert("Not a valid e-mail address");
          return false;
          }*/
        }
        </script>